package top.system.dept.pojo;

import java.util.HashMap;
import java.util.Map;

/**
 * @author: Amosen
 * @time: 2021-5-16
 */

// 这个实体类用来封装对客户端的响应信息
public class SysResp {

	private Integer code;

	private String message;

	private Map<String, Object> data = new HashMap<>();

	public SysResp() {
	}

	public SysResp(Integer code, String message, Map<String, Object> data) {
		this.code = code;
		this.message = message;
		this.data = data;
	}

	// 这个构造方法用于空数据的响应封装
	public SysResp(Integer code, String message) {
		this.code = code;
		this.message = message;
	}

	// 设置响应码
	public SysResp setCode(Integer code) {
		this.code = code;
		return this;
	}

	// 获取响应码
	public Integer getCode() {
		return this.code;
	}

	// 设置响应信息
	public SysResp setMessage(String message) {
		this.message = message;
		return this;
	}

	// 获取响应信息
	public String getMessage() {
		return this.message;
	}

	// 设置响应数据
	public SysResp setData(Map<String, Object> data) {
		this.data = data;
		return this;
	}

	// 获取响应数据
	public Map<String, Object> getData() {
		return this.data;
	}

	// toString
	@Override
	public String toString() {
		return "SysResp [code=" + code + ", message=" + message + ", data=" + data + "]";
	}

}
